// Tags:
#include <cctype>
#include <cstdio>

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

const int N = 5e6 + 5;
int n, ans[N];

void solve(int x, int s, int mul) {
  if (x == 2) {
    ans[s] = mul, ans[s + 1] = mul * 2;
    return;
  }
  if (x == 3) {
    ans[s] = ans[s + 1] = mul, ans[s + 2] = mul * 3;
    return;
  }
  for (int i = s; i <= s + ((x + 1) >> 1); ++i) { ans[i] = mul; }
  solve(x >> 1, s + ((x + 1) >> 1), mul << 1);
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen64("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen64("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("sequence.in", "r", stdin);
  freopen("sequence.out", "w", stdout);
#endif
#endif

  while (read(n) != 0) {
    if (n == 1) ans[1] = 1;
    else
      solve(n, 1, 1);
    for (int i = 1; i <= n; ++i) printf("%d", ans[i]), putchar(" \n"[i == n]);
  }
  return 0;
}